import { createStore } from 'vuex'

export default createStore({
  state: {
    openId: '66',
    username: '赵六',
    city: '郑州',
    name: '郑州市',
    title: '不凡学院',
    center: [113.598609, 34.747034]
  },
  getters: {
    data (states) {
      return {
        city: states.city,
        name: states.name,
        center: states.center,
        title: states.title
      }
    }
  },
  mutations: {
    keepOpenId (store, id) {
      store.openId = id
      console.log(store.openId)
    },
    uplocation (states, obj) {
      states.name = obj.name
      states.title = obj.name
      states.center = [obj.location.lng, obj.location.lat]
    }
  },
  actions: {
  },
  modules: {
  }
})
